﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using PersonaLibrary.Data;

namespace PersonaLibrary.Converters
{
	class EmployeeNotesConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			IEnumerable<EmployeeNoteLink> employee = value as IEnumerable<EmployeeNoteLink>;

			if(employee != null)
			{
				List<string> result = employee.Select(x => x.Note.Name).ToList();
				return string.Join(", ", result);
			}

			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
